package com.ldp.designpatterns.review.structure.decorator.demo2.decorator;

import com.ldp.designpatterns.review.structure.decorator.demo2.component.Battercake;

/**
 * @ClassName BattercakeDecorator
 * @Description TODO 第3步：创建抽象装饰器 Decorator
 * @Author lindipei
 * @Date 2023/10/20 17:22
 */
public abstract class BattercakeDecorator extends Battercake {
    // 静态代理，委托
    private Battercake battercake;

    public BattercakeDecorator(Battercake battercake) {
        this.battercake = battercake;
    }

    @Override
    public String getMessage() {
        return this.battercake.getMessage();
    }

    @Override
    public int getPrice() {
        return this.battercake.getPrice();
    }

    // 可以加额外功能方法
    public abstract void addedFunction();
}